package edu.nf.ch08;

/**
 * @author wangl
 * @date 2025/4/17
 */
public class Teacher {

    private Teacher(){}

    /**
     * 当调用get方法时，才初始化内部类实例化Teacher
     * @return
     */
    public static Teacher getInstance(){
        return InnerClass.INSTANCE;
    }

    /**
     * 静态内部类，在内部创建一个外部类的常量实例
     */
    private static class InnerClass {
        private static final Teacher INSTANCE = new Teacher();
    }
}